package com.education.mymediaplayer.ui;

import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.education.mymediaplayer.dao.NewsMediaInfo;
import com.education.mymediaplayer.utils.HttpUtils;

/**
 * Created by zhonghang on 16/6/22.
 */

public class MainPresenter implements MainContract.Presenter {
    private MainContract.View mView;
    private MainModle modle;
    public MainPresenter(MainContract.View view) {
        mView = view;
        mView.setPresenter(this);
        modle=new MainModle();
    }

    @Override
    public void init() {
        mView.onInit();
    }

    @Override
    public void getData(String url) {
        Log.d("------", "presenter获取数据");
        modle.getData(url, new HttpUtils.MyCallback() {
            @Override
            public void onFail() {
                mView.onLoadDataErro();
            }

            @Override
            public void onSuccess(String result) {

//                mView.onLoadData(result);
            }
        });
    }
}
